<!--
/*
 * SPDX-License-Identifier: GPL-3.0-or-later
 * Copyright 2014 The moOde audio player project / Tim Curtis
 *
 * 汉化：Androidnews
 *
*/
-->
<div id="container">
<div class="container">
	<h1 class="per-config">外围设备</h1>

	<form class="form-horizontal" method="post">
		<div class="control-group $_feat_localui">
			<legend>本地显示器</legend>

			<label class="control-label">显示</label>
			<div class="controls">
				<div class="toggle">
					<label class="toggle-radio toggle-localui" for="toggle-localui-2">开</label>$_select[localui_on]
					<label class="toggle-radio toggle-localui" for="toggle-localui-1">关</label>$_select[localui_off]
				</div>
                <button id="btn-set-localui" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_localui" value="novalue"><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-localui" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
				<span id="info-localui" class="config-help-info">
					Display moOde UI on locally attached display.
                </span>
            </div>

			<label class="control-label">播放唤醒</label>
			<div class="controls">
				<div class="toggle">
					<label class="toggle-radio toggle-wake-display" for="toggle-wake-display-2">开</label>$_select[wake_display_on]
					<label class="toggle-radio toggle-wake-display" for="toggle-wake-display-1">关</label>$_select[wake_display_off]
				</div>
                <button id="btn-set-wake-display" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_wake_display" value="novalue" $_ctl_disabled><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-wake-display" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
				<span id="info-wake-display" class="config-help-info">
					Wake the display when audio starts playing.
                </span>
            </div>

			<label class="control-label">鼠标光标</label>
			<div class="controls">
				<div class="toggle">
					<label class="toggle-radio toggle-touchscn" for="toggle-touchscn-2">开</label>$_select[touchscn_on]
					<label class="toggle-radio toggle-touchscn" for="toggle-touchscn-1">关</label>$_select[touchscn_off]
				</div>
                <button id="btn-set-touchscn" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_touchscn" value="novalue" $_ctl_disabled><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-touchscn" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
				<span id="info-touchscn" class="config-help-info">
					This prevents the cursor from showing on the display or Touch screen
                </span>
            </div>

			<label class="control-label">弹出式键盘</label>
			<div class="controls">
				<div class="toggle">
					<label class="toggle-radio toggle-on-screen-kbd" for="toggle-on-screen-kbd-2">开</label>$_select[on_screen_kbd_on]
					<label class="toggle-radio toggle-on-screen-kbd" for="toggle-on-screen-kbd-1">关</label>$_select[on_screen_kbd_off]
				</div>
                <button id="btn-set-on-screen-kbd" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_on_screen_kbd" value="novalue" $_ctl_disabled><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-on-screen-kbd" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
				<span id="info-on-screen-kbd" class="config-help-info">
					On-screen popup keyboard by @Nutul.
                </span>
            </div>

			<label class="control-label" for="scnblank">屏幕空白</label>
			<div class="controls">
				<select id="scnblank" class="config-select-large" name="scnblank" onchange="autoClick('#btn-set-scnblank');" $_ctl_disabled>
					$_select[scnblank]
				</select>
				<button id="btn-set-scnblank" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_scnblank" value="novalue" $_ctl_disabled><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-scnblank" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
				<span id="info-scnblank" class="config-help-info">
					When playback has stopped the display will be turned off after the specified time period.
                </span>
			</div>

			<div class="controls">
				<button class="btn btn-primary btn-medium config-btn btn-submit" type="submit" name="update_toggle_coverview" value="novalue" $_ctl_disabled>切换</button>
				<span class="config-btn-after">封面视图</span>
				<span class="config-help-static">
					当前切换状态: $_coverview_onoff
				</span>
			</div>

			<div class="controls">
				<a data-toggle="modal" href="#restart-localui" $_link_disabled><button class="btn btn-medium btn-primary config-btn" $_ctl_disabled>重启</button></a>
				<span class="config-btn-after">本地显示器</span>
				<span class="config-help-static">
					重新启动会清除chromium浏览器缓存.
				</span>
			</div>

			<label class="control-label">HDMI 4K 60Hz</label>
			<div class="controls">
				<div class="toggle">
					<label class="toggle-radio toggle-hdmi-enable-4kp60" for="toggle-hdmi-enable-4kp60-2">开</label>$_select[hdmi_enable_4kp60_on]
					<label class="toggle-radio toggle-hdmi-enable-4kp60" for="toggle-hdmi-enable-4kp60-1">关</label>$_select[hdmi_enable_4kp60_off]
				</div>
                <button id="btn-set-hdmi-enable-4kp60" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_hdmi_enable_4kp60" value="novalue" $_hdmi_4kp60_btn_disable><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-hdmi-enable-4kp60" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
				<span id="info-hdmi-enable-4kp60" class="config-help-info">
					By default, when connected to a 4K monitor, the Raspberry Pi 4B, 400 and CM4 will select a 30Hz refresh rate. Use this option to allow selection of 60Hz refresh rates.
                </span>
            </div>
		</div>

		<div class="control-group">
			<legend>Pi 7 inch Touch</legend>

			<label class="control-label" for="scnbrightness">亮度</label>
			<div class="controls">
            	<input class="config-input-large" type="number" maxlength="3" min="0" max="255" id="scnbrightness" name="scnbrightness" value="$_select[scnbrightness]" $_ctl_disabled>
				<button class="btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_scnbrightness" value="novalue" $_ctl_disabled><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-brightness" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
				<span id="info-brightness" class="config-help-info">
					Backlight brightness for 7" Pi Touch. Values are 0 - 255.
                </span>
			</div>

			<!-- No solution with KMS driver as of r902 -->
			<!--label class="control-label" for="pixel-aspect-ratio">Pixel aspect ratio</label>
			<div class="controls">
				<select id="pixel-aspect-ratio" class="config-select-large" name="pixel_aspect_ratio" onchange="autoClick('#btn-set-pixel-aspect-ratio');" $_ctl_disabled>
					$_select[pixel_aspect_ratio]
				</select>
				<button id="btn-set-pixel-aspect-ratio" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_pixel_aspect_ratio" value="novalue" $_ctl_disabled><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info_pixel_aspect_ratio" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
				<span id="info_pixel_aspect_ratio" class="config-help-info">
					Rectangular (default) or square pixels for 7" Pi Touch.
                </span>
			</div-->

			<label class="control-label" for="scnrotate">旋转屏幕</label>
			<div class="controls">
				<select id="scnrotate" class="config-select-large" name="scnrotate" onchange="autoClick('#btn-set-scnrotate');" $_ctl_disabled>
					$_select[scnrotate]
				</select>
				<button id="btn-set-scnrotate" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_scnrotate" value="novalue" $_ctl_disabled><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
			</div>
		</div>

		<div class="control-group">
			<legend>其它外设</legend>

			<div class="$_feat_gpio">
				<label class="control-label">GPIO按钮</label>
				<div class="controls">
					<div class="toggle">
						<label class="toggle-radio toggle-gpio-svc" for="toggle-gpio-svc-2">开</label>$_select[gpio_svc_on]
						<label class="toggle-radio toggle-gpio-svc" for="toggle-gpio-svc-1">关</label>$_select[gpio_svc_off]
					</div>
					<button id="btn-set-gpio-svc" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_gpio_svc" value="novalue"><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
					<a aria-label="Help" class="config-info-toggle" data-cmd="info-gpio-svc" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
					<span id="info-gpio-svc" class="config-help-info">
						Maps attached hardware buttons to MPD playback or other commands. By @Cyanoazimin.
                    </span>
				</div>

				<div class="controls">
					<a href="gpio-config.php"><button class="btn btn-medium btn-primary config-btn">编辑</button></a>
					<span class="config-btn-after">GPIO引脚映射</span>
				</div>
			</div>

			<label class="control-label">LCD更新</label>
			<div class="controls">
				<div class="toggle">
					<label class="toggle-radio toggle-lcdup" for="toggle-lcdup-2">开</label>$_select[lcdup_on]
					<label class="toggle-radio toggle-lcdup" for="toggle-lcdup-1">关</label>$_select[lcdup_off]
				</div>
				<button id="btn-set-lcdup" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_lcdup" value="novalue"><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-lcdup" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
				<span id="info-lcdup" class="config-help-info">
					The LCD update engine runs the lcd-updater.py script whenever UI state changes.<br>
					A stub lcd-updater.py script is located in the /var/local/www/commandw/ directory.
                </span>
			</div>
		</div>
	</form>
</div>
</div>

<form class="form-horizontal" method="post">
	<div id="restart-localui" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="restart-localui-label" aria-hidden="true">
		<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			<h3>重启本地显示器?</h3>
		</div>
		<div class="modal-body"></div>
		<div class="modal-footer">
			<button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
			<button class="btn btn-primary btn-submit" type="submit" name="update_restart_localui" value="novalue">确认</button>
		</div>
	</div>
</form>
